<template>
  <div class="app-container">
    <el-card>
      <div class="reviewTaskView-title-outBox">
        <div class="reviewTaskView-title">评审任务/任务详情</div>
        <div class="back-btn" @click="handBack">
          <img src="@/assets/images/tripartite/back_button.png" alt="" />返回
        </div>
      </div>
      <!-- 任务信息 -->
      <div class="model-outBox">
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>任务信息</span>
        </div>
        <el-descriptions border :column="1">
          <el-descriptions-item
            label="任务名称"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ reviewTask.taskName }}</el-descriptions-item
          >
          <el-descriptions-item
            label="创建时间"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ reviewTask.createTime }}</el-descriptions-item
          >
        </el-descriptions>
      </div>
      <!-- 项目信息 -->
      <div class="model-outBox">
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>项目信息</span>
        </div>
        <el-descriptions border :column="1">
          <el-descriptions-item
            label="项目名称"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.entryName }}</el-descriptions-item
          >
        </el-descriptions>
        <el-descriptions border :column="2">
          <el-descriptions-item
            label="项目性质"
            label-class-name="descriptions-item-label cancel-border-top"
            content-class-name="descriptions-item-content cancel-border-top"
            >{{
              isShowData.annualDeclarationVo ? "年度项目" : "增补项目"
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目类别"
            label-class-name="descriptions-item-label cancel-border-top"
            content-class-name="descriptions-item-content cancel-border-top"
            >{{
              annualDeclarationVo.projectCategory === '0'
                ? "建设类（新开工）"
                : annualDeclarationVo.projectCategory === '1'
                ? "建设类（续建）"
                : annualDeclarationVo.projectCategory === '2'
                ? "购买服务类"
                : annualDeclarationVo.projectCategory === '3'
                ? "运维类"
                : ""
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目投资估算(万元)"
            label-class-name="descriptions-item-label cancel-border-bottom"
            content-class-name="descriptions-item-content cancel-border-bottom"
            >{{
              annualDeclarationVo.projectInvestmentEstimation
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="资金来源"
            label-class-name="descriptions-item-label cancel-border-bottom"
            content-class-name="descriptions-item-content cancel-border-bottom"
            >{{
              annualDeclarationVo.sourceOfFunds == "0" ? "区财政资金" : annualDeclarationVo.sourceOfFunds == "1" ? "其他" :""
            }}</el-descriptions-item
          >
        </el-descriptions>
        <el-descriptions border :column="1">
          <el-descriptions-item
            label="项目建设理由"
            label-class-name="descriptions-item-label descriptions-item-height"
            content-class-name="descriptions-item-content descriptions-item-height"
            >{{
              annualDeclarationVo.reasonsForProjectConstruction
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目内容简介"
            label-class-name="descriptions-item-label descriptions-item-height"
            content-class-name="descriptions-item-content descriptions-item-height"
            >{{
              annualDeclarationVo.projectContentIntroduction
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="预期效果描述"
            label-class-name="descriptions-item-label descriptions-item-height"
            content-class-name="descriptions-item-content descriptions-item-height"
            >{{
              annualDeclarationVo.expectedEffectDescription
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目进展"
            label-class-name="descriptions-item-label descriptions-item-height"
            content-class-name="descriptions-item-content descriptions-item-height"
            >{{
              annualDeclarationVo.workCompletion
                ? annualDeclarationVo.workCompletion
                : annualDeclarationVo.preliminaryWorkCompletion
            }}</el-descriptions-item
          >
          <el-descriptions-item
            label="增补凭证"
            label-class-name="descriptions-item-label "
            content-class-name="descriptions-item-content "
            v-if="annualDeclarationVo.supplementaryVoucherFile"
          >
            <span
              class="pointer blueColor"
              @click="
                $download(annualDeclarationVo.supplementaryVoucherFile.fileUrl)
              "
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  annualDeclarationVo.supplementaryVoucherFile != null &&
                  annualDeclarationVo.supplementaryVoucherFile.fileUrl
                "
              />{{
                annualDeclarationVo.supplementaryVoucherFile &&
                annualDeclarationVo.supplementaryVoucherFile != null
                  ? annualDeclarationVo.supplementaryVoucherFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item>
          <el-descriptions-item
            label="项目建议书"
            label-class-name="descriptions-item-label "
            content-class-name="descriptions-item-content "
          >
            <span
              class="pointer blueColor"
              @click="$download(annualDeclarationVo.projectProposalFile?annualDeclarationVo.projectProposalFile.fileUrl:'')"
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  annualDeclarationVo.projectProposalFile != null &&
                  annualDeclarationVo.projectProposalFile.fileUrl
                "
              />{{
                annualDeclarationVo.projectProposalFile &&
                annualDeclarationVo.projectProposalFile != null
                  ? annualDeclarationVo.projectProposalFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item>
        </el-descriptions>
      </div>
      <!-- 联系方式 -->
      <div class="model-outBox">
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>联系方式</span>
        </div>
        <el-descriptions border :column="2">
          <el-descriptions-item
            label="业主单位"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.constructionUnit }}</el-descriptions-item
          >
          <el-descriptions-item
            label="责任科室"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.department }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目负责人"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.projectLeader }}</el-descriptions-item
          >
          <el-descriptions-item
            label="负责人电话"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.telephoneNumber }}</el-descriptions-item
          >
          <el-descriptions-item
            label="项目联系人"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.projectContact }}</el-descriptions-item
          >
          <el-descriptions-item
            label="联系人电话"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ annualDeclarationVo.contactTelephone }}</el-descriptions-item
          >
        </el-descriptions>
      </div>
      <!-- 方案申报 -->
      <div class="model-outBox" v-show="isShowData.schemeDeclarations">
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>方案申报</span>
        </div>
        <el-descriptions border :column="2">
          <el-descriptions-item
            label="设计单位"
            :span="2"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
            >{{ schemeDeclarations.designUnit }}</el-descriptions-item
          >
          <el-descriptions-item :span="1"
            label="评标方法" 
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content">
            <!-- {{schemeDeclarations ? schemeDeclarations.assessmentMethod === '0' ? '综合评分法' 
            : (schemeDeclarations.assessmentMethod === '1' 
            ? '最低评标价法' 
            : schemeDeclarations.assessmentMethod === '2' 
            ? '性价比法' 
            :schemeDeclarations.assessmentMethod === '3' 
            ? '其他' 
            :'')
            : ''}} -->
            {{schemeDeclarations ? schemeDeclarations.assessmentMethod : ''}}
          </el-descriptions-item>
          <el-descriptions-item :span="1"
            label="项目代码" 
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content">
            {{schemeDeclarations ? schemeDeclarations.projectCode : ''}}
          </el-descriptions-item>
          <el-descriptions-item
            label="系统架构简述"
            :span="2"
            label-class-name="descriptions-item-label descriptions-item-height"
            content-class-name="descriptions-item-content descriptions-item-height"
            >{{ schemeDeclarations.systemArchitecture }}</el-descriptions-item
          >
          <!-- <el-descriptions-item
            label="可行性研究报告"
            :span="2"
            label-class-name="descriptions-item-label "
            content-class-name="descriptions-item-content"
          >
            <span
              class="pointer blueColor"
              @click="downloadFile(schemeDeclarations.researchReportFile)"
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  schemeDeclarations.researchReportFile != null &&
                  schemeDeclarations.researchReportFile.fileName
                "
              />{{
                schemeDeclarations.researchReportFile &&
                schemeDeclarations.researchReportFile != null
                  ? schemeDeclarations.researchReportFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item> -->
          <el-descriptions-item
            label="可研批复(立项文件)"
            :span="2"
            label-class-name="descriptions-item-label "
            content-class-name="descriptions-item-content "
          >
            <span
              class="pointer blueColor"
              @click="$download(schemeDeclarations.budgetProposalFile?schemeDeclarations.budgetProposalFile.fileUrl:'')"
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  schemeDeclarations.budgetProposalFile != null &&
                  schemeDeclarations.budgetProposalFile.fileName
                "
              />{{
                schemeDeclarations.budgetProposalFile &&
                schemeDeclarations.budgetProposalFile != null
                  ? schemeDeclarations.budgetProposalFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item>
          <el-descriptions-item
            label="初设方案(可研代初设)"
            :span="2"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
          >
            <span
              class="pointer blueColor"
              @click="
                $download(schemeDeclarations.preliminaryDesignSchemeFile?schemeDeclarations.preliminaryDesignSchemeFile.fileUrl:'')
              "
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  schemeDeclarations.preliminaryDesignSchemeFile != null &&
                  schemeDeclarations.preliminaryDesignSchemeFile.fileName
                "
              />{{
                schemeDeclarations.preliminaryDesignSchemeFile &&
                schemeDeclarations.preliminaryDesignSchemeFile != null
                  ? schemeDeclarations.preliminaryDesignSchemeFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item>
          <!-- <el-descriptions-item
            label="预算方案"
            :span="2"
            label-class-name="descriptions-item-label "
            content-class-name="descriptions-item-content"
          >
            <span
              class="pointer blueColor"
              @click="downloadFile(schemeDeclarations.budgetProgrammeFile)"
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  schemeDeclarations.budgetProgrammeFile != null &&
                  schemeDeclarations.budgetProgrammeFile.fileName
                "
              />{{
                schemeDeclarations.budgetProgrammeFile &&
                schemeDeclarations.budgetProgrammeFile != null
                  ? schemeDeclarations.budgetProgrammeFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item> -->
          <!-- <el-descriptions-item
            label="云资源需求清单"
            :span="2"
            label-class-name="descriptions-item-label"
            content-class-name="descriptions-item-content"
          >
            <span
              class="pointer blueColor"
              @click="
                downloadFile(schemeDeclarations.cloudResourceApplicationFile)
              "
              ><img
                src="@/assets/images/tripartite/icon_files.png"
                v-show="
                  schemeDeclarations.cloudResourceApplicationFile != null &&
                  schemeDeclarations.cloudResourceApplicationFile.fileName
                "
              />{{
                schemeDeclarations.cloudResourceApplicationFile &&
                schemeDeclarations.cloudResourceApplicationFile != null
                  ? schemeDeclarations.cloudResourceApplicationFile.fileName
                  : ""
              }}
            </span>
          </el-descriptions-item> -->
        </el-descriptions>
      </div>
      <!-- 系统信息 -->
      <div
        v-show="
          isShowData.systemInfoVoList !== undefined &&
          isShowData.systemInfoVoList.length > 0
        "
      >
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>系统信息</span>
        </div>
        <el-table :data="systemInfoVoList" border class="table_technical">
          <el-table-column
            label="系统名称"
            align="center"
            width="400"
            :show-overflow-tooltip="true"
          >
            <template slot-scope="scope">
              <span v-show="!scope.row.show">{{ scope.row.systemName }}</span>
              <el-input
                v-show="scope.row.show"
                v-model="scope.row.systemName"
                placeholder="请输入"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column label="系统描述" align="center">
            <template slot-scope="scope">
              <span v-show="!scope.row.show">{{ scope.row.systemDesc }}</span>
              <el-input
                v-show="scope.row.show"
                v-model="scope.row.systemDesc"
                placeholder="请输入"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            label="是否申请云资源"
            align="center"
            prop="appIsCloud"
            width="288"
          >
            <template slot-scope="scope">
              <span>{{scope.row.appIsCloud==='0'?'否':scope.row.appIsCloud==='1'?'是':''}}</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!-- 政务数据资源目录清单 -->
      <div
        v-show="
          isShowData.governmentDataResourcesVoList !== undefined &&
          isShowData.governmentDataResourcesVoList.length > 0
        "
      >
        <div class="model-title other-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>政务数据资源目录清单</span>
        </div>
        <el-table
          :data="governmentDataResourcesVoList"
          border
          class="table_technical"
        >
          <el-table-column
            label="信息资源名称"
            align="center"
            prop="informationResourceName"
            :show-overflow-tooltip="true"
            width="228"
          >
          </el-table-column>
          <el-table-column
            label="信息资源来源系统"
            align="center"
            prop="informationResourceSourceSystem"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息资源源代码"
            align="center"
            prop="informationResourceCode"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息资源提供方"
            align="center"
            prop="informationResourceProvider"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="提供方内部部门"
            align="center"
            prop="providersInternalDepartment"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="资源提供方代码"
            align="center"
            prop="resourceProviderCode"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息资源摘要"
            align="center"
            prop="summaryOfInformationResources"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息资源格式分类"
            align="center"
            prop="classificationOfInformationResourceFormats"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息资源格式类型"
            align="center"
            prop="informationResourceFormatType"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="其他类型资源格式描述"
            align="center"
            prop="other"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="信息项名称"
            align="center"
            prop="informationItemName"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="数据类型"
            align="center"
            prop="typeOfData"
            width="228"
          >
          </el-table-column>
          <el-table-column
            label="数据长度"
            align="center"
            prop="dataLength"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="共享类型"
            align="center"
            prop="shareType"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="共享条件"
            align="center"
            prop="sharingConditions"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 共享方式分类"
            align="center"
            prop="sharingModeClassification"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 共享方式类型"
            align="center"
            prop="sharingModeType"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 是否向社会开放"
            align="center"
            prop="isOpen"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 开放条件"
            align="center"
            prop="openConditions"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 更新周期"
            align="center"
            prop="updateCycle"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 发布日期"
            align="center"
            prop="releaseDate"
            width="228"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label=" 平台目录标识"
            align="center"
            prop="platformDirectoryId"
            width="120"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
        </el-table>
      </div>
      <!-- 云资源需求 -->
      <div
        v-show="
          isShowData.cloudResourceRequirementVoList !== undefined &&
          isShowData.cloudResourceRequirementVoList.length > 0
        "
      >
        <div class="model-title other-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>云资源需求</span>
        </div>
        <el-table
          :data="cloudResourceRequirementVoList"
          border
          class="table_technical"
        >
          <el-table-column
            label="云服务器名称"
            align="center"
            prop="cloudServerName"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="CPU(核)"
            align="center"
            prop="cpu"
          ></el-table-column>
          <el-table-column
            label="内存(G)"
            align="center"
            prop="memory"
          ></el-table-column>
          <el-table-column label="硬盘" align="center" prop="hardDisk">
          </el-table-column>
          <el-table-column
            label="数量"
            align="center"
            prop="number"
          ></el-table-column>
        </el-table>
      </div>
      <!-- 物联设备信息 -->
      <div
        v-show="
          isShowData.iotDeviceInfoVoList !== undefined &&
          isShowData.iotDeviceInfoVoList.length > 0
        "
      >
        <div class="model-title other-title jytitle">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>物联设备信息</span>
          <el-button
            class="jybtn"
            size="mini"
            @click="gotoMonitor"
            type="primary"
            plain
            >集约化建设监测</el-button
          >
        </div>
        <el-table :data="iotDeviceInfoVoList" border class="table_technical">
          <el-table-column
            label="产品名称"
            align="center"
            prop="productName"
            :show-overflow-tooltip="true"
          >
          </el-table-column>
          <el-table-column
            label="参数"
            align="center"
            prop="deviceParam"
          ></el-table-column>
          <el-table-column
            label="数量"
            align="center"
            prop="deviceNum"
          ></el-table-column>
          <el-table-column
            label="建设地点"
            align="center"
            prop="constructionSite"
          ></el-table-column>
          <el-table-column
            label="建设方式"
            align="center"
            prop="constructionWay"
          ></el-table-column>
          <el-table-column
            label="设备功能"
            align="center"
            prop="deviceFunction"
          ></el-table-column>
        </el-table>
      </div>
      <!-- 审批进度 -->
      <div class="model-outBox">
        <div class="model-title">
          <img src="@/assets/images/tripartite/icon_title.png" />
          <span>审批进度</span>
        </div>
        <el-table :data="approvalList" border :cell-style="columnStyle">
          <el-table-column label="节点" align="center" prop="approvalNode" />
          <el-table-column
            label="开始时间"
            align="center"
            prop="startTime"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="结束时间"
            align="center"
            prop="endTime"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="操作人"
            align="center"
            prop="approvalOperator"
          />
          <el-table-column label="状态" align="center" prop="approvalStatus">
            <template slot-scope="scope">
              <span>{{ scope.row.approvalStatusName }}</span>
              <!-- <span>{{
                scope.row.approvalStatus == "0"
                  ? "已提交"
                  : scope.row.approvalStatus == "1"
                  ? "待审核"
                  : scope.row.approvalStatus == "2" ||
                    scope.row.approvalStatus == "23"
                  ? "已通过"
                  : scope.row.approvalStatus == "3"
                  ? "驳回"
                  : scope.row.approvalStatus == "4"
                  ? "退回修改"
                  : scope.row.approvalStatus == "5"
                  ? "待提交"
                  : scope.row.approvalStatus == "6"
                  ? "已提交"
                  : scope.row.approvalStatus == "7"
                  ? "待抽取专家"
                  : scope.row.approvalStatus == "8"
                  ? "已抽取专家"
                  : scope.row.approvalStatus == "9"
                  ? "待接收任务"
                  : scope.row.approvalStatus == "10"
                  ? "已接收任务"
                  : scope.row.approvalStatus == "11"
                  ? "待审批"
                  : scope.row.approvalStatus == "12"
                  ? "已审批"
                  : scope.row.approvalStatus == "13" ||
                    scope.row.approvalStatus == "49"
                  ? "待审批"
                  : scope.row.approvalStatus == "14" ||
                    scope.row.approvalStatus == "17" ||
                    scope.row.approvalStatus == "50"
                  ? "通过"
                  : scope.row.approvalStatus == "15" ||
                    scope.row.approvalStatus == "19"
                  ? "退回重申"
                  : scope.row.approvalStatus == "16"
                  ? "待审核"
                  : scope.row.approvalStatus == "18"
                  ? "通过需修改"
                  : scope.row.approvalStatus == "48"
                  ? "已转派"
                  : scope.row.approvalStatus == "51"
                  ? "退回重审"
                  : scope.row.approvalStatus == "60"
                  ? "待安排评审会议"
                  : "/"
              }}</span> -->
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" prop="createTime">
            <template slot-scope="scope">
              <!-- <el-button
                size="mini"
                type="text"
                @click="handExtract(scope.row)"
                v-show="
                  scope.row.approvalNode === '安排评审会议' &&
                  scope.row.approvalStatus == '7'
                "
                >抽取</el-button
              > -->
              <el-button
                size="mini"
                type="text"
                @click="handExpert(scope.row)"
                v-show="
                  scope.row.approvalNode === '接受任务' &&
                  scope.row.approvalStatus == '9'
                "
                >专家管理</el-button
              >
              <el-button
                size="mini"
                type="text"
                @click="handDialog(scope.row)"
                v-show="
                  scope.row.approvalStatus == '11' ||
                  scope.row.approvalStatus == '12'
                "
                >查看</el-button
              >
              <!-- <el-button
                size="mini"
                type="text"
                @click="handApprove(scope.row)"
                v-show="
                  scope.row.approvalNode === '意见汇总' &&
                  scope.row.approvalStatus == '13'
                "
                >审批</el-button
              > -->
              <!-- <el-button
                size="mini"
                type="text"
                @click="handApprove(scope.row)"
                v-show="
                  scope.row.approvalNode === '现场论证' &&
                  scope.row.approvalStatus == '16'
                "
                >审批</el-button
              > -->
              <!-- <el-button
                size="mini"
                type="text"
                @click="handDialog(scope.row)"
                v-show="
                  scope.row.approvalStatus == '60'
                "
                >安排评审会议</el-button
              > -->
            </template>
          </el-table-column>
          <el-table-column label="审批意见" align="center" prop="approvalOpinion" :show-overflow-tooltip="true"/>
          <el-table-column
              label="资料库"
              align="center"
              prop="relationFile"
            >
            <template slot-scope="scope">
              <span v-if="scope.row.approvalNode === '现场论证'">
                <ArgumentFileDialog  v-if="scope.row.relationFile && scope.row.relationFile.length < 1 " :index="scope.$index" :approvalId="scope.row.approvalId"></ArgumentFileDialog>
              </span>
              <span>
                  <el-tooltip class="item" effect="dark" v-for="item in scope.row.relationFile" :key="item.id" :content="item.fileName" :placement="scope.row.approvalNode === '现场论证'?'top':'left'">
                  <span v-if="scope.row.approvalNode === '现场论证'">
                    <span v-if="item.fileName" style="color:#3171ee" class="files-upload" @click="$download(item.fileUrl)">{{item.fileName}}</span>
                    <i v-if="item.fileName" class="el-icon-error icon-del" @click="handleDel(scope.row.approvalId)"></i>
                  </span>
                  <span v-else style="color:#3171ee" class="files-box" @click="$download(item.fileUrl)">{{item.fileName}}</span>
                </el-tooltip>
              </span>
              
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!-- 审批按钮 -->
      <div ref="handleBtn" style="marginTop:22px">
        <el-button type="primary" size="small" @click="handleAudit" :disabled="isDisable">审批</el-button>
      </div>
    </el-card>
    <!-- 意见汇总审批 弹窗 -->
    <ArgumentDialog
      :showArgumentDialog="showArgumentDialog"
      :proId="proId"
      :rowData="rowData"
      @changeShowDialog="changeShowDialog"
    ></ArgumentDialog>
    <!-- 在线预审 弹窗 -->
    <ViewDialog
      :showViewDialog="showViewDialog"
      :proId="proId"
      :timeData="timeData"
      @changeShowDialog="changeShowDialog"
    ></ViewDialog>
    <!-- 安排评审会议 弹窗 -->
    <ArrangeMeetingDialog
      :showArrangeMeetingDialog="showArrangeMeetingDialog"
      :proId="proId"
      @changeShowDialog="changeShowDialog"
    >
    </ArrangeMeetingDialog>
        <!-- 意见汇总审批 弹窗 -->
    <ExtractExpertDialog
      :showExtractExpertDialog="showExtractExpertDialog"
      :proId="proId"
      :isShowData="isShowData"
      :reviewTask="reviewTask"
      @changeShowDialog="changeShowDialog"
    ></ExtractExpertDialog>
    <!-- 方案修改 -->
    <EditDialog
      :editShow.sync="editShow"
      :proid="proId"
      @changeShowDialog="changeShowDialog"
    ></EditDialog>
  </div>
</template>
<script>
import { listThird, delTask, getTask } from "@/api/tripartiteReview/reviewTask";
import { delFile } from "@/api/manage/manage";
import ArgumentDialog from "./components/argumentDialog";
import ViewDialog from "./components/viewDialog";
import ArrangeMeetingDialog from "./components/arrangeMeetingDialog";
import ExtractExpertDialog from "./components/extractExpertDialog";
import ArgumentFileDialog from "@/views/components/argumentFileDialog";
import EditDialog from "@/views/manage/components/editDialog";

export default {
  components: {
    ArgumentDialog,
    ViewDialog,
    ArrangeMeetingDialog,
    ExtractExpertDialog,
    ArgumentFileDialog,
    EditDialog
  },
  data() {
    return {
      // 是否显示弹出层
      showArgumentDialog: false,
      showViewDialog: false,
      showArrangeMeetingDialog:false,
      showExtractExpertDialog:false,
      editShow: false, //方案修改
      spanArr: [], //用于存放每一行记录的合并数
      pos: 0,
      isShowData: {},
      // 任务信息
      reviewTask: {},
      // 项目信息
      annualDeclarationVo: {},
      // 方案申报
      schemeDeclarations: {
        budgetProgrammeFile: { fileName: "", fileUrl: "" },
        budgetProposalFile: { fileName: "", fileUrl: "" },
        preliminaryDesignSchemeFile: { fileName: "", fileUrl: "" },
        researchReportFile: { fileName: "", fileUrl: "" },
      },
      // 系统信息
      systemInfoVoList: [],
      // 政务数据资源目录清单
      governmentDataResourcesVoList: [],
      // 云资源需求
      cloudResourceRequirementVoList: [],
      // 物联设备信息
      iotDeviceInfoVoList: [],
      //审批进度列表
      approvalList: [],
      //审批进度列表--默认阶段、节点展示
      approvalsDefaultList: [
        { approvalStage: "项目申报", approvalNode: "转派任务" },
        { approvalStage: "项目申报", approvalNode: "安排评审会议" },
        { approvalStage: "方案申报", approvalNode: "接受任务" },
        { approvalStage: "方案申报", approvalNode: "在线预审", show: false},
        { approvalStage: "项目实施", approvalNode: "意见汇总" },
        { approvalStage: "项目验收", approvalNode: "三方预审审核", show: false },
        { approvalStage: "方案申报", approvalNode: "现场论证" },
        { approvalStage: "项目验收", approvalNode: "三方论证审核" },
        { approvalStage: "方案申报", approvalNode: "方案修改", show: false },
      ],
      options: [],
      proId: undefined,
      rowData: {},
      isDisable:false, //审批按钮是否可以点击
      timeData:'',//在线预审查看时 查询时间参数
    };
  },
  created() {
    this.$nextTick(() => {
      this.getTaskList().then(()=>{
        this.handIsDisable();
      });
    });
  },
  watch: {
    // approvalList(newval, oldval) {
    //   this.getSpanArr(newval);
    // },
  },
  mounted() {
    this.getSpanArr(this.approvalList);
  },
  methods: {
    // 获取任务详情
    getTaskList() {
      const reviewTaskId = this.$route.query.reviewTaskId;
      return getTask(reviewTaskId).then((response) => {
        this.isShowData = response.data;
        // 任务信息
        if (response.data.reviewTask && response.data.reviewTask != null) {
          this.reviewTask = response.data.reviewTask;
        }
        // 年度申报
        if (
          response.data.annualDeclarationVo &&
          response.data.annualDeclarationVo != null
        ) {
          this.annualDeclarationVo = response.data.annualDeclarationVo;
        } else {
          // 增补申报
          if (
            response.data.supplementaryDeclarationVo &&
            response.data.supplementaryDeclarationVo != null
          ) {
            this.annualDeclarationVo = response.data.supplementaryDeclarationVo;
          }
        }

        // 方案申报
        if (
          response.data.schemeDeclarations &&
          response.data.schemeDeclarations != null
        ) {
          this.schemeDeclarations = response.data.schemeDeclarations;
        }
        // 系统信息
        if (
          response.data.systemInfoVoList &&
          response.data.systemInfoVoList != null
        ) {
          this.systemInfoVoList = response.data.systemInfoVoList;
        }
        // 政务数据资源目录清单
        if (
          response.data.governmentDataResourcesVoList &&
          response.data.governmentDataResourcesVoList != null
        ) {
          this.governmentDataResourcesVoList =
            response.data.governmentDataResourcesVoList;
        }
        // 云资源需求
        if (
          response.data.cloudResourceRequirementVoList &&
          response.data.cloudResourceRequirementVoList != null
        ) {
          this.cloudResourceRequirementVoList =
            response.data.cloudResourceRequirementVoList;
        }
        // 物联设备信息
        if (
          response.data.iotDeviceInfoVoList &&
          response.data.iotDeviceInfoVoList != null
        ) {
          this.iotDeviceInfoVoList = response.data.iotDeviceInfoVoList;
        }
        //审核进程
        if (response.data.approvalList && response.data.approvalList != null) {
          // this.approvalList = response.data.approvalList;
          let data = [];
          // response.data.approvalList.forEach((item,index) => {
          //   if ()
          // })
          this.approvalsDefaultList.map((item, index) => {
            let flag = false;
            response.data.approvalList.map((item1) => {
              if (item.approvalNode == item1.approvalNode) {
                data.push({ ...item, ...item1 });
                data.sort(function (a, b) {
                  return (
                    new Date(a.startTime).getTime() -
                    new Date(b.startTime).getTime()
                  );
                });
                flag = true;
                return false;
              } else {
                return false;
              }
            });
            if (flag == false) {
              if (item.show == false) {
                return;
              } else {
                data.push(item);
              }
            }
            this.approvalList = data;
            return false;
          });
        } else {
          this.approvalList = this.approvalsDefaultList;
        }
      });
    },
    // 附件下载
    downloadFile(file) {
      if (file) {
        window.location.href = file.fileUrl;
      }
    },
    // 跳转设备集约监测
    gotoMonitor() {
      this.$router.push({
        path: "/equipmentMonitor",
        query: {
          proid: this.proId,
        }
      });
    },
    /** 对表格单列样式更改 */
    columnStyle({ row, column, rowIndex, columnIndex }) {
      if (columnIndex == 0) {
        //第1列的背景色就改变
        return "background:#f8f8f9";
      }
    },
    // 合并表格
    getSpanArr(data) {
      for (var i = 0; i < data.length; i++) {
        if (i === 0) {
          this.spanArr.push(1);
          this.pos = 0;
        } else {
          // 判断当前元素与上一个元素是否相同
          if (data[i].approvalStage === data[i - 1].approvalStage) {
            this.spanArr[this.pos] += 1;
            this.spanArr.push(0);
          } else {
            this.spanArr.push(1);
            this.pos = i;
          }
        }
      }
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        const _row = this.spanArr[rowIndex];
        const _col = _row > 0 ? 1 : 0;
        return {
          // [0,0] 表示这一行不显示， [2,1]表示行的合并数
          rowspan: _row,
          colspan: _col,
        };
      }
    },
    /** 返回按钮操作 */
    handBack() {
      this.$router.push({
        path: "/tripartiteReview/reviewTask",
      });
    },
    handleSure(row) {
      if (row.show == true) {
        row.show = false;
      }
    },
    /** 修改按钮操作 新增系统信息*/
    handleEdit(row) {
      if (row.show == false) {
        row.show = true;
      }
    },
    /** 按钮操作 审批*/
    handApprove(row) {
      this.proId = row.projectId;
      this.rowData = row;
      this.showArgumentDialog = true;
    },
    /** 按钮操作 查看*/
    handDialog(row) {
      this.proId = row.projectId;
      if(row.approvalStatus == 11 || row.approvalStatus == 12){
        this.showViewDialog = true;
        this.timeData=row.createTime;
      }
      if(row.approvalNode === '在线预审' && row.approvalStatus == 60){
        this.showArrangeMeetingDialog = true;
      }
    },
    /** 按钮操作 专家管理*/
    handExpert(row) {
      this.$router.push({
        path: "/business_manage/manage/expertsdraw/details",
        query: {
          id: this.reviewTask.reviewTaskId,
        },
      });
    },
    /** 按钮操作 抽取*/
    handExtract(row) {
      this.$router.push({
        path: "/business_manage/manage/projectPlan",
        query: {
          projectId: row.projectId,
          info:
            this.reviewTask.taskName +
            row.approvalStage +
            "评审." +
            this.reviewTask.reviewType,
          enterType: "third",
        },
      });
    },
    /** 显示隐藏 弹窗操作 审批按钮*/
    handleAudit(){
      this.proId = this.isShowData.projectId
      if(this.reviewTask.nodeStatus === '7'){
        this.showExtractExpertDialog=true
      }else if(this.reviewTask.nodeStatus === '13' || this.reviewTask.nodeStatus === '16'){
        this.rowData.approvalStatus = this.reviewTask.nodeStatus
        this.showArgumentDialog = true;
      }else if(this.reviewTask.nodeStatus === '60'){
        this.showArrangeMeetingDialog = true;
      }else if(this.reviewTask.nodeStatus === '57'){
        this.editShow = true;
      }
    },
    /** 判断审批按钮是否可以点击 */
    handIsDisable(){
      if(this.reviewTask.nodeStatus === '7'||      
      this.reviewTask.nodeStatus === '13'||
      this.reviewTask.nodeStatus === '16'||
      this.reviewTask.nodeStatus === '57'||
      this.reviewTask.nodeStatus === '60'){
        this.isDisable=false;
        window.scrollTo({
          top: this.$refs.handleBtn.offsetTop - 24,
          behavior: "smooth",
        });
      }else{
        this.isDisable=true;
      }
    },
    changeShowDialog(data) {
      if (data == "false") {
        this.showArgumentDialog = false;
        this.showViewDialog = false;
        this.showArrangeMeetingDialog =false;
        this.showExtractExpertDialog=false;
        this.editShow=false;
        this.getTaskList();
      } else {
        this.showArgumentDialog = true;
        this.showViewDialog = true;
        this.showArrangeMeetingDialog = true;
        this.showExtractExpertDialog=true;
        this.editShow=true;
      }
    },
    /** 现场论证 删除附件 */
    handleDel(approvalId){
      delFile(approvalId).then(res=>{
        if(res.code === 200){
          this.$message.success('删除成功')
          this.getTaskList()
        }
      })
    },
  },
};
</script>
<style scoped lang="scss">
.reviewTaskView-title-outBox {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  .reviewTaskView-title {
    font-weight: 500;
    font-size: 18px;
    font-family: "PingFang SC";
  }
  .back-btn {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    img {
      width: 16px;
      height: 16px;
      margin-right: 6px;
      position: relative;
      top: 2px;
    }
  }
}
.submit-outBox {
  width: 100%;
  text-align: center;
  .btn {
    width: 200px;
  }
}
.jytitle {
  display: flex;
  // justify-content: space-between;
  align-items: center;
  position: relative;
}
.model-title {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #ebecef;
  border-top: 1px solid #ebecef;
  margin-bottom: 24px;
  margin-top: 24px;
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  img {
    width: 16px;
    height: 16px;
    position: relative;
    right: 5px;
    top: 2px;
  }
  .jybtn {
    position: absolute;
    right: 0;
  }
}
.files-box{
  width: 100%;
  line-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  float: left;
  cursor: pointer;
}
.files-upload{
  width: 80%;
  line-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  float: left;
  cursor: pointer;
}
.icon-del{
  margin-top: 12px;
  margin-left: 5%;
}
</style>
<style lang="scss">
/*表单label不加粗  */
label {
  font-weight: normal !important;
}
/* el-descriptions-item 文字居中 */
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
  text-align: center;
}
.model-outBox {
  /* 信息描述组件样式更改 */
  .descriptions-item-label {
    width: 266px;
  }
  .descriptions-item-content {
    text-align: left !important;
    img {
      width: 16px;
      height: 16px;
      margin-right: 10px;
      position: relative;
      top: 4px;
    }
  }
  .cancel-border-top {
    border-top: 0 !important;
  }
  .cancel-border-bottom {
    border-bottom: 0 !important;
  }
  .descriptions-item-height {
    height: 108px;
  }
}
</style>
